<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>获取、增加、删除节点</title>
	</head>

	<body>
		<ul id="myUL">
			<li>春</li>
			<li id="summer">夏</li>
			<li>秋</li>
			<li>冬</li>
		</ul>
		<script>
			var ul = document.getElementById('myUL');
			var summer = document.getElementById('summer');
			console.log("ul的所有子节点是：" + ul.childNodes);
			console.log("ul的第一个节点是：" + ul.firstChild);

			var h1=document.createElement('h1');
			h1.innerHTML="一年四季";
			ul.appendChild(h1);

			ul.lastElementChild.remove();
		</script>
	</body>

</html>